package com.blog.system.api.feign;

import com.blog.common.core.constant.ServiceNameConstants;
import com.blog.common.core.domain.R;
import com.blog.common.domain.entity.SiteConfig;
import com.blog.system.api.factory.RemoteConfigFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * <p>
 * 网站配置服务
 * </p>
 *
 * @author Valerie
 * @date 2023/4/15
 **/
@FeignClient(contextId = "remoteConfigService", value = ServiceNameConstants.ADMIN_SERVICE, fallbackFactory = RemoteConfigFallbackFactory.class)
public interface RemoteConfigService {

    /**
     * 获取网站配置
     *
     * @return {@link R<String>}
     */
    @GetMapping("/website/config")
    R<SiteConfig> getWebsiteConfig();

    /**
     * 保存网站图片
     *
     * @return {@link R<Void>}
     */
    @PutMapping("/website/pageCover")
    R<Void> saveSitePageCover();
}
